﻿using HP.HPTRIM.Service;
using ServiceStack.ServiceInterface;
using ServiceStack.ServiceInterface.Auth;

namespace OneLoginPlugin
{
    public class Reconfigure : IReconfigure
    {
        public void Configure(ServiceStack.WebHost.Endpoints.IAppHost appHost)
        {
            var appSettings = new ServiceStack.Configuration.AppSettings();

            appHost.Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] {
						new SAMLAuthProvider(appSettings)
					}) { HtmlRedirect = "~/SAMLLogin" });
        }
    }
}
